/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.manager.impl;

import java.util.Collection;
import java.util.List;

import com.xy.biz.ts.domain.po.ExaminationQuestionPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.ExaminationQuestionBO;
import com.xy.biz.ts.domain.query.ExaminationQuestionQuery;
import com.xy.biz.ts.domain.converter.ExaminationQuestionConverter;
import com.xy.biz.ts.manager.ExaminationQuestionManager;
import com.xy.biz.ts.dao.ExaminationQuestionDao;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author wcs
 * @date 2021-3-8
 */
@Service
public class ExaminationQuestionManagerImpl implements ExaminationQuestionManager {

	@Autowired
	private ExaminationQuestionDao examinationQuestionDao;

	@Override
	public ExaminationQuestionPO saveExaminationQuestion(ExaminationQuestionBO examinationQuestionBO) {
		ExaminationQuestionPO examinationQuestionPO = ExaminationQuestionConverter.toPO(examinationQuestionBO);
		examinationQuestionDao.saveExaminationQuestion(examinationQuestionPO);
		return examinationQuestionPO;
	}

	@Override
	public int saveAllExaminationQuestion(Collection<ExaminationQuestionBO> collection) {
		return examinationQuestionDao.saveAllExaminationQuestion(ExaminationQuestionConverter.toPO(collection));
	}

	@Override
	public int updateExaminationQuestion(ExaminationQuestionBO examinationQuestionBO) {
		return examinationQuestionDao.updateExaminationQuestion(ExaminationQuestionConverter.toPO(examinationQuestionBO));
	}

	@Override
	public int deleteExaminationQuestion(Long examinationQuestionId) {
		return examinationQuestionDao.deleteExaminationQuestion(examinationQuestionId);
	}

	@Override
	public ExaminationQuestionBO getExaminationQuestion(Long examinationQuestionId) {
		return ExaminationQuestionConverter.fromPO(examinationQuestionDao.getExaminationQuestion(examinationQuestionId));
	}

	@Override
	public List<ExaminationQuestionBO> listExaminationQuestionById(Collection<Long> collection) {
		return ExaminationQuestionConverter.fromPO(examinationQuestionDao.listExaminationQuestionById(collection));
	}

	@Override
	public List<ExaminationQuestionBO> listExaminationQuestion(ExaminationQuestionQuery query) {
		return ExaminationQuestionConverter.fromPO(examinationQuestionDao.listExaminationQuestion(query));
	}

	@Override
	public int countExaminationQuestion(ExaminationQuestionQuery query) {
		return examinationQuestionDao.countExaminationQuestion(query);
	}

}
